<%@ page import="aqv.Politician" %>
<!DOCTYPE html>
<html class="no-js" lang="en">

	<head>
		<meta name="layout" content="aqvLayout2">
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<meta charset="utf-8"/>
		<title>A quien voto | Editar politico</title>
	</head>
	<body>

		<!-- SUBHEADER
		================================================== -->
		<div id="subheader">
			<div class="row">
				<div class="twelve columns">
					<p class="left">
						 Editar politico
					</p>
					<p class="right">
						 <g:link controller="politician" action="index">Lista de politicos</g:link>
					</p>
				</div>
			</div>
		</div>
		<div class="hr">
		</div>

		<div class="row">
		
			<div class="five columns">
				<h5>Recordatorio:</h5>
				<p>Recorda que los datos que introduscas seran verificados por el lider de tu partido politico.</p>
				<p>Si la informacion que sugeris es valida y correcta, se podra visualizar tan pronto el responsable de tu partido politico la autorice.</p>
			</div>
		
			<!-- CONTACT FORM -->
<%--			<div class="twelve columns">--%>
			<div class="seven columns">
				<div class="wrapcontact">

					
					<fieldset>
					
						<legend>Datos Personales</legend>
						<g:hasErrors bean="${politicianInstance}">
							<g:eachError bean="${politicianInstance}" var="error">
								<div class="alert-box alert"><g:message error="${error}"/></div>
							</g:eachError>
						</g:hasErrors>
						
						<g:form id="editPoliticianFormID" url="[resource:politicianInstance, action:'update']" method="PUT"  enctype="multipart/form-data">
							<g:render template="form"/>
							<g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
						</g:form>
						
					</fieldset>
					
					
				</div>
			</div>

		</div>
		<div class="hr">
		</div>
		
<%--	TEST <g:javascript src="external.js">	--%>
		<g:javascript>
			$( document ).ready(function() {
	
				$("#editPoliticianFormID").on({
				
						submit: function(){
							if (${session.user.politicalParty.id} != $("#politicalParty").val() ) {
								alert("Debes pertenecer al mismo partido politico para editar informacion.");
								return false;
							}
						}
					
				});
				
			});
		</g:javascript>

	</body>
</html>


<%----%>
<%--<%@ page import="aqv.Politician" %>--%>
<%--<!DOCTYPE html>--%>
<%--<html>--%>
<%--	<head>--%>
<%--		<meta name="layout" content="main">--%>
<%--		<g:set var="entityName" value="${message(code: 'politician.label', default: 'Politician')}" />--%>
<%--		<title><g:message code="default.edit.label" args="[entityName]" /></title>--%>
<%--	</head>--%>
<%--	<body>--%>
<%--		<a href="#edit-politician" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>--%>
<%--		<div class="nav" role="navigation">--%>
<%--			<ul>--%>
<%--				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>--%>
<%--				<li><g:link class="list" action="index2"><g:message code="default.list.label" args="[entityName]" /></g:link></li>--%>
<%--				<li><g:link class="create" action="create2"><g:message code="default.new.label" args="[entityName]" /></g:link></li>--%>
<%--			</ul>--%>
<%--		</div>--%>
<%--		<div id="edit-politician" class="content scaffold-edit" role="main">--%>
<%--			<h1><g:message code="default.edit.label" args="[entityName]" /></h1>--%>
<%--			<g:if test="${flash.message}">--%>
<%--			<div class="message" role="status">${flash.message}</div>--%>
<%--			</g:if>--%>
<%--			<g:hasErrors bean="${politicianInstance}">--%>
<%--			<ul class="errors" role="alert">--%>
<%--				<g:eachError bean="${politicianInstance}" var="error">--%>
<%--				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>--%>
<%--				</g:eachError>--%>
<%--			</ul>--%>
<%--			</g:hasErrors>--%>
<%--			<g:form url="[resource:politicianInstance, action:'update']" method="PUT"  enctype="multipart/form-data">--%>
<%--				<g:hiddenField name="version" value="${politicianInstance?.version}" />--%>
<%--				<fieldset class="form">--%>
<%--					<g:render template="form"/>--%>
<%--				</fieldset>--%>
<%--				<fieldset class="buttons">--%>
<%--					<g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />--%>
<%--				</fieldset>--%>
<%--			</g:form>--%>
<%--		</div>--%>
<%--	</body>--%>
<%--</html>--%>
